package com.x.sys.controller;


import java.util.Arrays;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.x.common.bo.JsonResult;
import com.x.common.bo.PageObject;
import com.x.sys.entity.SysRole;
import com.x.sys.service.SysRoleService;


@RestController
@RequestMapping("/role/")
public class SysRoleController {
	@Autowired
private SysRoleService sysRoleService;
	@RequestMapping("doDeleteObjects")
	//@ResponseBody
	
	public JsonResult doDeleteObjects(Integer...ids) {
		System.out.println(Arrays.toString(ids));
		//调用业务层方法执行删除业务
		sysRoleService.deleteObjects(ids);
		return new JsonResult("删除成功!");
	}
	@RequestMapping("doFindPageObjects")
	public JsonResult doFindPageObject(String name,Integer pageCurrent) {
		PageObject<SysRole> pageObject=
				sysRoleService.findPageObjects(name,pageCurrent);
		return new JsonResult(pageObject);
	}
}
